<div class="header clearfix">
    <div class="headerTop">
        <span>您好,
            <#if Session["ylrc_home"]?exists>
                ${Session["ylrc_home"].mobile}
                <input type="hidden" value=" ${Session["ylrc_home"].id}" id="homeUserId">
            </#if>
            欢迎登录。
        </span>

        <a id="logout" style="margin-left: 10px">退出</a>
    </div>
</div>


<script>
    $('#logout').click(function () {
        layer.confirm('您确定退出吗？', {
            btn: ['确定', '取消']
        }, function () {
            $.ajax({
                url: '/home/index/logout',
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    if (data.code == 0) {
                        window.location.href = "/home/index";
                    } else {
                        errorMsg(data.msg);
                    }
                }
            });
        })
    });
</script>